<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMachineManagersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('machine_managers', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('manager_id')->default(0)->comment('管理者ID');
            $table->tinyInteger('type')->comment('类型');
            $table->bigInteger('machine_id')->comment('设备ID,1平台2经销商3商户4操作员');
            $table->decimal('percentage',10,2)->comment('分成百分比');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('machine_managers');
    }
}
